
import * as THREE from 'three';
import { AmbientLight, DirectionalLight,Vector3 } from 'three';
import { threeExport } from './threeExport';
interface lightUtil{
    ambientLight: AmbientLight | undefined,
    ambientLightColor: string,
    ambientLightIntensity: number,
    directionalLight: DirectionalLight |undefined,
    directionalLightColor:string,
    directionalLightIntensity:number,
    directionalLightPosition:Vector3
}
export const lightUtil =<lightUtil> {
    ambientLight: undefined,
    ambientLightColor: '0xffffff',
    ambientLightIntensity: 1,
    directionalLight: undefined,
    directionalLightColor:'0xaabbff',
    directionalLightIntensity:0.3,
    directionalLightPosition:new THREE.Vector3(300,250,500)
}
export function createLight():void {
    if (threeExport.scene) {
        // lightUtil.ambientLight = new THREE.AmbientLight(lightUtil.ambientLightColor, lightUtil.ambientLightIntensity);
        // threeExport.scene.add(lightUtil.ambientLight);
        const light1 = new THREE.DirectionalLight(0xffffff, 0.2)
        light1.position.set(0, 0, 10)
        threeExport.scene.add(light1)
        const light2 = new THREE.DirectionalLight(0xffffff, 0.2)
        light2.position.set(0, 0, -10)
        threeExport.scene.add(light2)
        const light3 = new THREE.DirectionalLight(0xffffff, 0.2)
        light3.position.set(10, 0, 0)
        threeExport.scene.add(light3)
        const light4 = new THREE.DirectionalLight(0xffffff, 0.2)
        light4.position.set(-10, 0, 0)
        threeExport.scene.add(light4)

        const light5 = new THREE.DirectionalLight(0xffffff, 0.2)
        light5.position.set(0, 10, 0)
        threeExport.scene.add(light5)
        const light6 = new THREE.DirectionalLight(0xffffff, 0.2)
        light6.position.set(5, 10, 0)
        threeExport.scene.add(light6)
        const light7 = new THREE.DirectionalLight(0xffffff, 0.2)
        light7.position.set(0, 10, 5)
        threeExport.scene.add(light7)
        const light8 = new THREE.DirectionalLight(0xffffff, 0.2)
        light8.position.set(0, 10, -5)
        threeExport.scene.add(light8)
        const light9 = new THREE.DirectionalLight(0xffffff, 0.2)
        light9.position.set(-5, 10, 0)
        threeExport.scene.add(light9)
    }
}